<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<!--定义住院病历模板片段-->
<div th:fragment="patient-record-template">
    <form id="patient-record-form" class="form-horizontal">
        <fieldset>
            <div class="form-group">
                <div class="control-group">
                    <label class="control-label" for="patientName">患者姓名</label>
                    <div class="controls">
                        <input name="patientName" data-for-template="patientName" type="text" th:value="${medicalRecord.patientName}" class="input-xlarge" id="patientName" disabled/>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="control-group">
                    <label class="control-label" for="todayWard">今日查房</label>
                    <div class="controls">
                        <textarea name="todayWard" class="form-control" id="todayWard" data-for-template="todayWard"></textarea>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="control-group">
                    <label class="control-label" for="discussion">拟诊讨论</label>
                    <div class="controls">
                        <textarea name="discussion" class="form-control" id="discussion" data-for-template="discussion"></textarea>
                    </div>
                </div>
            </div>
        </fieldset>
    </form>
    <script th:inline="javascript">
        // 解析内容并渲染模板值
        parseContentAndRender();
        // 获取表单数据
        function getFormData() {
            var formData = $("#patient-record-form").serializeJson();
            console.log("formData: ", formData)
            return formData;
        }
    </script>
</div>

</html>